package com.atomgit.ai.proxy.processor.service;

import com.atomgit.ai.proxy.entity.ModelInfo;
import com.atomgit.ai.proxy.entity.UserApiKey;
import com.atomgit.ai.proxy.param.PromptParam;
import com.atomgit.ai.proxy.vo.ModelAnswerVO;
import org.springframework.http.HttpMethod;

import javax.servlet.http.HttpServletResponse;

public interface ParamAndResponseProcessor {


    String getApiKey(ModelInfo modelInfo,UserApiKey userApiKey);

    String getUrl(ModelInfo modelInfo,UserApiKey userApiKey);

    /**
     * 生成请求体参数
     * @param param
     * @return
     */
    String generateRequestBody(PromptParam param);

    /**
     * 解析模型返回结果
     * @param responseBody
     * @return
     */
    ModelAnswerVO generateModelAnswerVO(String responseBody);

    String sendRequestInStream(String url, HttpMethod httpMethod, String requestBody, String apiKey, HttpServletResponse response, ParamAndResponseProcessor paramAndResponseProcessor);

}
